var str=`
fjskfjsl fjkdsjfkls fjklsfjlsd127.0.60.1fjksldfjafjio jfk192.168.1.101sljfs fsdjfkldsfjsklfsklffjoijfoiaf
asfjs fed jfjf jf sdjfsi jfi jafis function dd ( ) { }afjsdiajf iosa function abc(){} jfisjad fjsaiofjaoissf
addedfds
`;
var re1=/[\d]{3}.[\d]{1,3}.[\d]{1,3}.[\d]{1,3}/g;
var result;
do{
  result=re1.exec(str);
  console.log(result && result[0]);

}while(result)


var re2=/function\s+[a-zA-Z]+\s*\(\s*\)\s*\{\s*\}/gi;
do{
  result=re2.exec(str);
  console.log(result && result[0]);
}while(result)
